package beautiful.butterfly.drds.binlog.event;


import lombok.Getter;
import lombok.Setter;

public class EventHeader
{
    // v1 (MySQL 3.23)
    @Setter
    @Getter
    private long timestamp;
    @Setter
    @Getter
    private EventType eventType;
    @Setter
    @Getter
    private long serverId;
    @Setter
    @Getter
    private long eventLength;
    // v3 (MySQL 4.0.2-4.1)
    @Setter
    @Getter
    private long nextPosition;
    @Setter
    @Getter
    private int flags;

    public EventHeader()
    {

    }

    public long getHeaderLength()
    {
        return 19;
    }

    public long getDataLength()
    {
        return eventLength - getHeaderLength();
    }


}
